package com.erlang.spring.service.impl;

import com.erlang.spring.dao.AccountDao;
import com.erlang.spring.pojo.Account;
import com.erlang.spring.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description：账户服务service实现类
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {

  @Autowired
  private AccountDao accountDao;

  @Override
  public int saveAccount(Account account) {
    return accountDao.saveAccount(account);
  }

  @Override
  public int deleteAccountById(int id) {
    return accountDao.deleteAccountById(id);
  }

  @Override
  public int updateAccountById(Account account) {
    return accountDao.updateAccountById(account);
  }

  @Override
  public Account findAccountById(int id) {
    return accountDao.findAccountById(id);
  }

  @Override
  public List<Account> findAll() {
    return accountDao.findAll();
  }

  @Override
  public Integer countAccount() {
    return accountDao.countAccount();
  }
}